Method of generating signal amplitude responsive to desired function, and converter

ABSTRACT

The invention relates to a method for generating a signal amplitude behaving according to a desired function and to a converter implementing the method. In the method, a function that is used for controlling the behaviour of a signal amplitude is piecewise linearized to provide straight lines; a slope and a constant term of each straight line is stored in a memory ( 202  and  203 ); and a midpoint of each straight line is shifted to form an origin in a common coordinate system. Variable data ( 213 ) is used as address data, which is divided into an MSB ( 207 ) and an LSB part ( 208 ). The MSB part ( 207 ) is used for addressing from the memory ( 202  and  203 ) the slope and the constant term of the straight line. The LSB part ( 208 ) functions as a variable of a common coordinate system of the straight lines. The amplitude is generated by summing in a summer ( 205 ) a product determined by the slope and the LSB part to the constant term, the product being generated in means ( 204 ) as a selected summing of arithmetically shifted, masked and complemented slopes controlled by the LSB part.

FIELD OF THE INVENTION

The invention relates to a method for generating a signal amplitudebehaving according to a desired function; in said method amplitude isgenerated digitally and variable data of the function is used as addressdata.

The invention also relates to a converter for generating a signalamplitude behaving according to a desired function, the converter beingarranged to generate the amplitude digitally and to use variable data ofthe function as address data.

BACKGROUND OF THE INVENTION

In Direct Digital Synthesis (DDS), desired signal behaviour is achievedby converting digital phase data or other variable data to digitalamplitude data, for instance by means of look-up tables. The digitalamplitude data can then be converted to an analog amplitude by adigital-to-analog converter, or the amplitude data can be further usede.g. for signal phase or frequency processing.

A sine form signal converted from phase data represents a typical DDSconversion. The simplest way to perform the conversion is to storeamplitude values of a sine function in a ROM memory (Read Only Memory)functioning as a look-up table, said values being indicated by the phasedata. The use of look-up table alone will, however, lead to extensivedeployment of memory which, in turn slows down the converter and thefrequency of the signal obtained from the converter.

To reduce the need for memory, it is possible to approximate thefunction according to which the amplitude is to behave. One alternativeis to use the Taylor series expansion disclosed in U.S. Pat. No.4,905,177. From the series expansion are taken into account three firstterms, which are used for making the conversion. An impairment of themethod is that it requires a third, non-linear term and a multiplier forperforming multiplication. Due to such shortcomings, the solution isslow.

SUMMARY OF THE INVENTION

An object of the present invention is thus to provide a solution whichapplies an amplitude according to a desired function in an approximativemanner and which uses neither non-linear terms nor multiplication.

This is achieved with a method of the type described in the preamble,characterized by representing a desired amplitude behaviour in anapproximative manner by means of a predetermined number N of piecewisestraight lines, an slope and a constant term of which are stored, saidstraight lines being generated using a linear regression or the like andcomprising a predetermined number M of variable values; dividing addressdata in two parts, a first part functioning as an address for the slopeand the constant term of each straight line and a second partcorresponding to a variable value on each piecewise straight line;converting the addresses of the second part of the address data tonegative and positive variable values of the straight lines so that anaddress substantially in the middle of the second part of the addressdata becomes a variable value, which is preferably zero; selecting, bymeans of the first part of the address data, the slope and the constantterm of each generated approximative straight line and selecting, bymeans of the second part, a variable value on a piecewise straight line;generating, by means of the variable value and the slope, a coefficientterm of the piecewise straight line; generating a desired amplitudevalue by summing the coefficient term and the constant term of thepiecewise straight line.

This is achieved with a method of the type described in the preamble,characterized by generating, by means of straight lines, a piecewiselinear approximation of a function g(z)=f(z)−tz, where f(z) is afunction according to which the amplitude is to behave, z is a variablevalue and t is a constant, said approximation comprising a predeterminednumber N of straight lines, an slope and a constant term of which arestored; said straight lines being generated by a linear regression orthe like and comprising a predetermined number M of variable values;dividing address data in two parts, a first part functioning as anaddress for the slope and the constant term and for the first part tz ofthe address data, multiplied by the constant, in each straight line, anda second part corresponding to a variable value on each piecewisestraight line; converting addresses of the second part of the addressdata to negative and positive variable values so that an addresssubstantially in the middle of the address data becomes a variablevalue, which is preferably zero; selecting, by means of the first partof the address data, the slope, the constant term and the first part tzof the address data, multiplied by the constant, in each generated,approximative straight line, and selecting, by means of the second part,a variable value on the piecewise straight line; generating, by means ofthe variable value and the slope determined by the second part of theaddress data, an slope of the piecewise straight line; generating adesired amplitude value by summing the coefficient term, the constantterm and the first part tz of the address data, multiplied by theconstant, of the piecewise straight line.

A converter of the invention is characterized in that the convertercomprises a memory for describing the behaviour of an amplitudeaccording to a desired function on approximatively piecewise straightlines, with an slope and a constant term being stored in a memory, saidstraight lines being generated by a linear regression or the like andcomprising a predetermined number of variable values; means for dividingthe address data in two parts, a first part determining the slope andthe constant term of each generated approximative straight line, and asecond part corresponding to variable values of each piecewise straightline; means for converting addresses of the second part of the addressdata to positive and negative variable values so that an addresssubstantially in the middle of the second part of the address databecomes a variable value, which is preferably zero, and for generating,by means of the variable value and the slope based on the second part ofthe address data, a coefficient term of a piecewise straight line; meansfor generating desired amplitude data by summing the coefficient termand the constant term of the piecewise straight line.

The converter of the invention is characterized in that the convertercomprises a memory for generating, by means of straight lines, apiecewise linear approximation of a function g(z)=f(z)−tz, where f(z) isa function according to which an amplitude is to behave, z is a variableand t is a constant, the approximation comprising a predetermined numberN of straight lines, with an slope and a constant term being stored inthe memory, said straight lines being generated using a linearregression or the like and comprising a predetermined number M ofvariable values; means for generating a first part tz of the addressdata multiplied by the constant; means for dividing the address data intwo parts, a first part determining the slope and the constant term ofeach generated approximative straight line, and a second partcorresponding to variable values of each piecewise straight line; meansfor converting the addresses of the second part of the address data topositive and negative variable values so that an address substantiallyin the middle of the address data becomes a variable value, which ispreferably zero, and for generating a coefficient term of the piecewisestraight line, by using the slope and the variable value based on thesecond part of the address data; means for summing a first constant partand the first part tz of the address data multiplied by the constant andmeans for generating a desired amplitude data by summing the coefficientpart and the corrected constant part of the piecewise straight line.

The method of the invention provides considerable advantages. Anapproximative method allows the size of the memory to be reduced, thusaccelerating the operation of the inventive solution. In addition, theoperation of the solution can be speeded up by avoiding multiplicationoperations.

DESCRIPTION OF THE DRAWINGS

In the following the invention will be described in more detail, withreference to the examples illustrated in the attached drawings, in which

FIG. 1 is a graphic illustration of a solution of the invention appliedto a signal behaving according to a sine function;

FIG. 2 is a graphic illustration of a solution of the invention appliedto a signal behaving according to a function sin(z)−tz;

FIG. 3 is a block diagram illustrating a converter of the invention;

FIG. 4 is a block diagram illustrating a converter of the invention; and

FIG. 5 is a block diagram illustrating a correcting part of a converterof the invention.

DESCRIPTION OF PREFERRED EMBODIMENTS

A solution of the invention is well-suited for generating ahigh-frequency signal, which makes the invention particularly suitablefor a digital radio system where it can be used for generating forinstance a sine-form carrier wave. The solution provides a digitalamplitude value, based on a desired function, that can be used directlyas an amplitude value of a signal, or the amplitude value can be used toguide a phase, frequency or other characteristic of the signal. Theprinciple of the solution is suited to the generating of any signalbased on a function that can be linearized.

In a method of the invention a function according to which the signalamplitude is to behave is piecewise linearized to generate straightlines; an slope and a constant term of each straight line is stored; anda shift from one coordinate system to another is made so that themidpoint of each straight line moves to the origin of a commoncoordinate system of the straight lines. A variable of the originalfunction provides address data used for indicating the slope and theconstant term of the approximative straight line. The variable of thecommon coordinate system of the straight lines is then multiplied by theslope for generating the coefficient term, and the constant term isadded to the coefficient term for generating the amplitude value.

Let us now study the method of the invention with reference to FIGS. 1and 2. FIG. 1 shows one quarter of a sine function. An entire sinefunction can be generated from a single quarter by means of simplemappings. A cosine function, in turn, is generated by means of a phaseshift of a sine function. FIG. 1 shows a straight line which acquires atpoints z=0 and z=Π/2 the same values as a sin(z). This example assumesthat a signal amplitude behaving according to a sine function is to begenerated. A general case of the method is one where a desired functionf is approximatively linearized using N straight lines. An slope k₁ anda constant term c₁ of the straight lines thus change according to thevalue of the variable z in such a way that with each value z only onestraight line approximates the function f(z), i.e.${f(z)} \approx \left\{ {\begin{matrix}{{k_{1}z} + c_{1}} \\{{k_{2}z} + c_{2}} \\\cdots \\{{k_{N}z} + c_{N}}\end{matrix},} \right.$

where z is a variable and k₁ and c₁ are constants. The curve of the sinefunction is thus piecewise linearly approximated by means of N straightlines y=k₁z+c_(i), where i ∈[1, 2, . . . , N]. M points are selected onan approximative part of each straight line. In the method the curve islinearized by any method suitable for piecewise linearization, forinstance by linear regression. Linearization can provide a continuous ordiscontinuous, piecewise linear approximation of a desired function. Inconnection with linearization the straight lines are preferably moved toone and the same coordinate system, whereby the variable z is changed toa variable x, and a midpoint 103 of the approximative part of thestraight line is set at the origin. The information that the originalvariable z comprises is thus used in such a way that part of theinformation of the z variable determines the approximative straight lineand part of it determines the value of the x variable associated withthe straight line. In the method the slope k_(i) and the constant partc_(i) of each straight line are stored in a memory and their values canbe retrieved from the memory on the basis of a rough value of thevariable z, which is preferably an MSB part (Most Significant Bits). Aprecise part of the z variable, which is preferably an LSB part (LeastSignificant Bits), determines which point on the piecewise straight linehas been selected of the x variable, allowing the amplitude value to bedetermined. This is performed by multiplying the value of the x variableby the value of the slope k_(i) and adding the constant term c_(i) to acoefficient term _(i)k x thus obtained.

FIG. 2 illustrates a case in which a linear function, i.e. a formulag(z)=sin(z)−(tz+a) where t and a represent constants, is subtracted froma sine function. In the example the function g is precisely${{\sin (z)} - {\frac{2}{\pi}z}},$

whereby the straight line receives the same values as sin(z) at pointsz=0 and $z = {\frac{\pi}{2}.}$

The straight line ${I(z)} = {\frac{2}{\pi}z}$

is shown in FIG. 1 below the curve of the function sin(z). In thesolution of the invention, the linearization of the function g isperformed in the same way as in FIG. 1, the calculation of the amplitudebeing also performed in the same way. In this solution the generating ofa final amplitude behaving according to the desired function sin(z)requires, however, that the impact of the linear part l(z) is restored.

In a linear regression the linear dependence of v from w needs to beknown and the curve is therefore a straight line. One linear regressionmethod is the method of the least square sum. In this method is selecteda straight line to which the sum of square distances of all the pointsin the quantity of points is the smallest. In a solution of theinvention, the quantity of points comprises the signal amplitude valueson the part to be approximated. Each approximative straight line can beexpressed using the formula $\begin{matrix}{{v - \hat{v}} = \left. {k_{i}\left( {w - \hat{w}} \right)}\Rightarrow \right.} & (2) \\{{v = {{k_{i}w} + c_{i}}},} & \text{(2b)}\end{matrix}$

where k_(i) is an slope, c_(i) is a constant part, {circumflex over (v)}is a mean value of variable v and {circumflex over (w)} is a mean valueof variable w. So the form of k_(i) is $\begin{matrix}{{k_{i} = \frac{s_{wv}}{s_{v}^{2}}},} & (3)\end{matrix}$

where s_(wv) represents covariance between variables w and v, and S_(w)represents variance of variable w. Variance is calculated for instanceas follows $\begin{matrix}{{s_{w} = {\frac{1}{n - 1}{\sum\limits_{j = 1}^{n}\left( {w_{j} - \hat{w}} \right)^{2}}}},} & (4)\end{matrix}$

where w_(j) is a point j of variable w. Covariance s_(wv) of variables,in turn, is calculated for instance using the formula $\begin{matrix}{{s_{wv} = {\frac{1}{n - 1}{\sum\limits_{j = 1}^{n}{\left( {w_{j} - \hat{w}} \right)\left( {v_{j} - \hat{v}} \right)}}}},} & (5)\end{matrix}$

where v_(j) is a point j of variable v. The form of constant part c₁, inturn, is c_(i)={circumflex over (v)}−k_(i){circumflex over (w)}. In theinventive method, absolute values can be used instead of squares. Linearregression can also be replaced by other similar methods for generatingstraight lines. The method used for generating the straight lines is notimportant in the invention, the only important thing is the piecewiselinearization of the function related to the signal.

Let us now study a practical implementation of the invention in greaterdetail with reference to FIGS. 3 to 5. In a converter 10 according toFIG. 3, means 201 divide variable data 213 of n bits in two parts. Afirst part 207 of the variable data, which is preferably an MSB part,addresses an approximation to a straight line and determines from it anslope k_(i) in means 203 and a constant part c_(i) in means 202, means202 and 203 being preferably ROM memories. A second part 208 of thevariable data, which is preferably an LSB part, determines a point onthe approximative straight line. Means 204 use the first part 207 of thevariable data of an slope 210 and the variable data 208 for generatingamplitude data 211 corresponding to a straight line traversing theorigo. Said data 211 is summed in means 205 to a constant term 209,obtaining thus approximated amplitude data 212, which can be correctedby rounding in means 206. In rounding, decimal parts are rounded to anearest whole number. Over-accuracy preferably used in the calculationcan be removed by reducing LSB bits. Using over-accuracy in thecalculation reduces the quantization error. LSB bits are preferablyreduced by arithmetically shifting the bit sequence of an amplitude tothe left. The dividing of variable data 213 in means 201 is importantfor the inventive solution, because the dividing of the variable data213 allows smaller memories to be used.

The coefficient k_(i) in means 203 is preferably multiplied by a half ofthe M number of points on an approximative straight line. Amultiplication operation is preferably not performed, but the slopeproducts are generated in advance, in connection with the linearization,and stored in the means 203. So, if the number of points on one straightline is M=32, the slope k_(i) is multiplied by 16. This increases theaccuracy of the calculation and enables a multiplication product to begenerated in the means 204 without actual multiplication, using anarithmetical shifting of slope data, multiplexing of arithmeticallyshifted slopes, masking, complementing and summing performed bycontrolling of the second part 208 of the variable data.

FIG. 4 illustrates a solution of a converter 10 in a situation where thelength of the output data of means 202 is shortened by removing at leastone MSB bit from output data 302. This can be performed at least on sinefunctions. In more concrete terms, this means that from any desiredfunction g(z) generating a desired amplitude for a signal is subtracteda linear function. i.e. when a sine function is concerned, for instancesin(z)−tz where t is any freely selected constant, as shown in FIG. 2.This reduces the size of the memory in the means 202, if t is suitablyselected. In the case of a sine function, t is preferably$t = {\frac{2}{\pi}.}$

When amplitude data comprises as many bits as variable data 213, i.e.n=WO, variable data z can be subtracted directly from the value offunction g(z). In other case means 251, which proportion the firstconstant part 302, are needed. The means 251 receive the first part 207(the MSB bits) of the variable data, said part preferably comprising pbits. As regards the operation of the solution, it is possible that p+mbits, i.e. the entire variable data, would arrive at the means 251. Theproportioning according to bit quantity is most preferably performed bymultiplying the MSB bit/bits of the variable data 213 by a ratio WO/p orWO/(p+m) or in a similar manner. A proportioning product 301 is summedto the first constant part 302 in means 252 and a proportioned constantterm 209 is summed to the product 211 according to the inventivesolution. The solution can also be implemented using a device accordingto FIG. 3 to generate the slope and the constant part by means of afunction g(z)=f(z)−tz and by adding the linear part tz to the generatedproduct 212, for instance in the means 206. If the first part 207 of thevariable data, which has p bits, is used in the proportioning, z in thelinear part to be subtracted must also be proportioned, wherebyt*int(z/2^(m)), which corresponds to the number of LSB bits, issubtracted instead of the part tz.

FIG. 5 is a block diagram illustrating an inventive means 204, whichenables a direct multiplication operation to be avoided. Sincemultiplication is a slow operation, avoiding it speeds up the operationof the inventive solution. The means 204 comprises multiplexing means401, masking means 402, complementing means 403, a summer 404 and aswitching means 405 controlling the operation and receiving the secondpart 208 of the variable data. The number of the multiplexing means 401,masking means 402 and complementing means 403 depends on the M number ofpoints on the approximative straight line. In FIG. 4, S0 represents theslope data 210 arriving from the means 203 as such; S1 represents theslope data 210 arithmetically shifted one bit to the right,corresponding to division by two; S2 represents the slope data 210arithmetically shifted two bits to the right, corresponding to divisionby four: S3 represents the slope data 210 arithmetically shifted threebits to the right, corresponding to division by eight; and S4 representsthe slope data 210 arithmetically shifted four bits to the right,corresponding to division by sixteen. The arithmetic shifts areperformed for instance in the means 203 or, in connection withmultiplexing, in the means 401. All multiplication products between theslope data and a point 101 on an approximative straight line can begenerated as a combination of the arithmetically shifted slope data. Atable can then be produced on how to combine the arithmetically shiftedslope data. The number of different combination alternatives is almostunlimited, one advantageous criterion being, however, that coefficientdata arriving at one and the same multiplexing means are not used insumming, i.e. for instance arithmetically shifted data S0 and S1 are notsimultaneously accepted to means 404. A desired operation is thusobtained using for instance table 1. Table 1 is based on the assumption,by way of example, that M points on a straight line is 2⁵=32. Acorresponding table can be produced for any number of points on astraight line, provided that the M points is a power of two. The means204 converts the second part 208 of the variable data to positive andnegative variable values (z−>x) in connection with the arithmeticshifting of slope bits, multiplexing, masking, complementing andsumming.

TABLE 1 Example of an arithmetic shifting of bits to be summed forgenerating a multiplication product in the means 204. b₁ - a₁ shift 0masked 1 S4 2 S3 3 S2 − S4 4 S2 5 S2 + S4 6 S2 + S3 7 S1 − S4 8 S1 9S1 + S4 10  S1 + S3 11  S1 + S2 − S4 12  S1 + S2 13  S1 + S2 + S4 14  S0− S3 15  S0 − S4

In table 1, S1+S2−S4 represents a summing of terms S1 and S2, form whichis subtracted S4. The subtraction is performed by complementing S4. Intable 1, preferably only half of the points on a straight line that areon a particular side of a point in the middle (shown with a thick linein FIG. 1) are taken into account. This is possible because the valuesof the points on the other side of the point in the middle of thestraight line can be calculated by complementing the values of thepoints generated. This procedure advantageously reduces the size of thememory and speeds up the operation of the inventive method. Thecomplementing is performed using either 2 or 1-complementation.

Combinations according to table 1 are obtained by means of a switchingmeans 405 controlling the operation, said means separately enabling ordisabling the operation of the means 401 to 403. The switching means 405can be provided using logic circuits or in the form of a table, usingmemory circuits in a manner apparent to a person skilled in the art. Theoutput of the means 405 is the second part 208 of the variable data,said part functioning as the output of logic circuits and/or as theaddress of memory circuits.

Also a ½-LSB offset can be performed on data to be complemented, so asto allow particularly amplitudes corresponding to a full 2Π circle of asequence of a sine function to be simplified. A ½-LSB offset allows1-complementation instead of 2-complementation to be performed withoutan error, and 1-complementation, in turn, saves hardware because1-complementation can be performed using an exclusive or-port XOR. Inaddition, the constant term c₁ and the coefficient term ₁k can be storedin one memory, instead of two separate memories, because they haveidentical addresses. This reduces both the size of the memory and thesurface of a VLSI chip.

Although the invention is described above with reference to an examplein the attached drawings, it is apparent that the invention is notrestricted to it, but can vary in many ways within the inventive ideadisclosed in the attached claims

What is claimed is:
 1. A method for generating a signal amplitude behaving according to a desired function; in said method amplitude is generated digitally and variable data (213) of the function is used as address data, comprising: representing a desired amplitude behaviour in an approximative manner by means of a predetermined number N of piecewise straight lines each of which has a slope (210) and a constant term (209) that are stored, and said straight lines being generated using a linear regression and comprising a predetermined number M of variable values; dividing address data (213) in two parts, a first part (207) functioning as an address for the slope and the constant term of each straight line and a second part (208) corresponding to a variable value on each piecewise straight line; converting addresses of the second part (208) of the address data to negative and positive variable values of the straight lines so that an address substantially in the middle of the second part (208) of the address data becomes a variable value, which is preferably zero; selecting, by means of the first part (207) of the address data, the slope (210) and the constant term (209) of each generated approximative straight line and selecting, by means of the second part (208), a variable value on a piecewise straight line; generating, by means of the variable value and the slope, a coefficient term (211) of the piecewise straight line; generating a desired amplitude value (212) by summing the coefficient term (211) and the constant term (209) of the piecewise straight line.
 2. The method according to claim 1, further comprising providing the function, according to which the amplitude is to behave, as a sequential sine or cosine function, the amplitude values of the whole sequence of which are generated of already generated amplitude values of a quarter sequence.
 3. The method according to claim 1, further comprises multiplying the slope (210) of a straight line, for improved accuracy, by a number that is a half of the number M of the values on the piecewise straight line; and when the number M of variable values on the piecewise straight line is a power of two, a conversion of the address data between negative variable values and positive variable values and an operation corresponding to the generating of a product between the second part (208) of the address data and the slope (210) are performed by an arithmetic shift, masking and complementing of the bits of the slope (210), and by summing of the arithmetically shifted, masked and complemented slopes; said conversion and operation being controlled by the second part (208) of the address data.
 4. The method according to claim 3, wherein generating the coefficient term (211) of the piecewise straight line further comprises converting addresses of the second part (208) to positive and negative variable values and generating the slope (210) based on the second part (208), wherein the conversion includes bit complementing.
 5. The method according to claim 4, wherein at when a ½-bit phase shift is used, the complementing is performed by 1-complementation.
 6. The method according to claim 3, wherein when a ½-bit phase shift is used, the complementing is performed by 1-complementation.
 7. The method according to claim 1, further comprising providing a reduction in a quantization error in order to increase amplitude accuracy, the method is implemented using over-accuracy which is removed from the amplitude value (212) in the end.
 8. The method according to claim 1, wherein generating the coefficient term (211) of the piecewise straight line further comprises converting addresses of the second part (208) to positive and negative variable values and generating the slope (210) based on the second part (208), wherein the conversion includes bit complementing.
 9. The method according to claim 8, wherein when a ½-bit phase shift is used, the complementing is performed by 1-complementation.
 10. A method for generating a signal amplitude behaving according to a desired function; in said method amplitude is generated digitally and variable data (213) of the function is used as address data, comprising: generating, by means of straight lines, a piecewise linear approximation of a function g(z)=f(z)−tz, where f(z) is a function according to which the amplitude is to behave, z is a variable value and t is a constant, said approximation comprising a predetermined number N of straight lines a slope (210) and a first constant part (302) of which are stored; said straight lines being generated by a linear regression and comprising a predetermined number M of variable values; dividing the address data (213) in two parts, a first part (207) functioning as an address for the slope (210) and the first constant part (302) of each straight line and for a first part tz (301) of the address data multiplied by the constant, and a second part (208) corresponding to a variable value on each piecewise straight line; converting addresses of the second part (208) of the address data to positive and negative variable values so that an address substantially in the middle (103) of the address data becomes a variable value, which is preferably zero; selecting, by means of the first part (207) of the address data, the slope (210), the first constant (302) and the first part tz (301) of the address data, multiplied by the constant, in each generated approximative straight line, and selecting, by means of the second part (208), the variable value on the piecewise straight line; generating, by means of the variable value and the slope (210) determined by the second part (208) of the address data, a coefficient term (211) of the piecewise straight line; generating a desired amplitude value (212) by summing the coefficient term (211), the first constant part (302) and the first part tz (301) of the address data, multiplied by the constant, of the piecewise straight line.
 11. The method according to claim 10, further comprising providing the function, according to which the amplitude is to behave, as a sequential sine or cosine function the amplitude values of the whole sequence of which are generated of already generated amplitude values of a quarter sequence.
 12. The method according to claim 10, further comprises multiplying the slope (210) of a straight line, for improved accuracy, by a number representing a half of the M values on the piecewise straight line; and when the number M of variable values on the piecewise straight line is a power of two, a conversion of the address data to negative and positive variable values and an operation corresponding to the generating of a product between the second part (208) of the address data and the slope (210) are performed by an arithmetic shift, masking and complementing of the bits of the slope (210), and by summing of the arithmetically shifted, masked and complemented slopes, said conversion and operation being performed by controlling the second part (208) of the address data.
 13. The method according to claim 12, wherein when a ½-bit phase shift is used, the complementing is performed by 1-complementation.
 14. The method according to claim 12, wherein generating the coefficient term (211) of the piecewise straight line further comprises converting addresses of the second part (208) to positive and negative variable values and generating the slope (210) based on the second part (208), wherein the conversion includes bit complementing.
 15. The method according to claim 14, wherein when a ½-bit phase shift is used, the complementing is performed by 1-complementation.
 16. The method according to claim 10, further comprising providing a reduction in a quantization error in order to increase amplitude accuracy, the method is implemented using over-accuracy which is removed from the amplitude value (212) in the end.
 17. The method according to claim 10, wherein generating the coefficient term (211) of the piecewise straight line further comprises converting addresses of the second part (208) to positive and negative variable values and generating the slope (210) based on the second part (208), wherein the conversion includes bit complementing.
 18. The method according to claim 17, wherein when a ½-bit phase shift is used, the complementing is performed by 1-complementation.
 19. A converter (10) for generating a signal amplitude behaving according to a desired function, the converter being arranged to generate the amplitude digitally and to use variable data (213) of the function as address data, wherein the converter (10) comprises a memory (202 and 203) for describing the behaviour of an amplitude according to a desired function on approximatively piecewise straight lines, with a slope (210) and a constant term (209) being stored in the memory (202 and 203), said straight lines being generated by a linear regression and comprising a predetermined number of variable values; means (201) for dividing the address data in two part, a first part (207) determining the slope (210) and the constant term (209) of each generated approximative straight line, and the second part (208) corresponding to variable values of each piecewise straight line; means (204) for converting the addresses of the second part of the address data to positive and negative variable values so that an address substantially in the middle of the second part (208) of the address data becomes a variable value, which is preferably zero, and for generating, by means of the variable value and the slope (210) based on the second part (208) of the address data, a coefficient term (211) of the piecewise straight line; means (205) for generating desired amplitude data (212) by summing the coefficient term (211) and the constant term (209) of the piecewise straight line.
 20. The converter (10) according to claim 19, wherein the converter (10) is arranged to generate a sequential signal amplitude (212) preferably behaving according to a sine or cosine function.
 21. The converter (10) according to claim 19, wherein, for improved accuracy, the means (204) are arranged to multiply the slope (210) of the straight line by a number equal to a half of a number of points on the piecewise straight line and means (204) are arranged to convert the second part (208) of the address data between negative variable values and positive variable values to perform an operation corresponding to multiplication between the variable value and the slope (210) by an arithmetic shift, masking and complementing of bits of the slope, and by summing; wherein the conversion and operation being controlled by the second part (208) of the address data.
 22. The converter (10) according to claim 19, wherein when the coefficient term (211) and the slope (210) are in ½-LSB phase shift, means (204) and means (403) are arranged to perform a complementation as 1-complementation.
 23. The converter (10) according to claim 19, further comprising a reduction in a quantization error for increased amplitude accuracy, the converter (10) is arranged to use over-accuracy, which means (206) are arranged to remove in the end from the amplitude (212).
 24. The converter (10) according to claim 19, wherein the generation of the coefficient term (211) of the piecewise straight line further comprises converting addresses of the second part (208) to positive and negative variable values and generating the slope (210) based on the second part (208), wherein the conversion includes bit complementing.
 25. The converter (10) according to claim 24, wherein when the coefficient term (211) and the slope (210) are in ½-LSB phase shift, means (204) and mean (403) are arranged to perform a complementation as 1-complementation.
 26. A converter (10) for generating a signal amplitude behaving according to a desired function, the converter being arranged to generate the amplitude digitally and to use variable data (213) of the function as address data, wherein the converter (10) comprises a memory (202 and 203) for generating, by means of straight lines, a piecewise linear approximation of a function g(z)=f(z)−tz, where f(z) is the function according to which an amplitude (212) is to behave, z is a variable and t is a constant, the approximation comprising a predetermined number N of straight lines, with a slope (210) and a first constant part (302) being stored in the memory (202 and 203), said straight lines being generated by a linear regression and comprising a predetermined number M of variable values; means (251) for generating a first part tz (301) of the address data multiplied by a constant; means (201) for dividing the address data in two parts, a first part (207) determining the slope (210) and the constant term (209) of each generated approximative straight line, and the second part (208) corresponding to variable values of each piecewise straight line; means (204) for converting the addresses of the second part of the address data to positive and negative variable values so that an address substantially in the middle of the address data becomes a variable value, which is preferably zero, and for generating a coefficient term (211) of a piecewise straight line, using a variable value and the slope (210) based on the second part (208) of the address data; means (252) for summing a first constant part (302) and the first part tz (301) of the address data multiplied by the constant; and means (205) for generating desired amplitude data (212) by summing the coefficient part (211) and the corrected constant part, constant term (209), of the piecewise straight tine.
 27. The converter (10) according to claim 26, wherein the converter (10) is arranged to generate a sequential signal amplitude (212) preferably behaving according to a sine or cosine function.
 28. The converter (10) according to claim 26, wherein, for improved accuracy, the means (204) are arranged to multiply the slope (210) of the straight line by a number equal to a half of a number of points on the piecewise straight line and means (204) are arranged to convert the second part (208) of the address data between negative variable values and positive variable values to perform an operation corresponding to multiplication between the variable value and the slope (210) by an arithmetic shift, masking and complementing of bits of the slope, and by summing; wherein the conversion and operation being controlled by being controlled by the second part (208) of the address data.
 29. The converter (10) according to claim 28, wherein when the coefficient term (211) and the slope (210) are in ½-LSB phase shift, means (204) and mean (403) are arranged to perform a complementation as 1-complementation.
 30. The converter (10) according to claim 26, further comprising a reduction in a quantization error for increased amplitude accuracy, the converter (10) is arranged to use over-accuracy, which means (206) are arranged to remove in the end from the amplitude (212).
 31. The converter (10) according to claim 26, wherein the generation of the coefficient term (211) of the piecewise straight line further comprises converting addresses of the second part (208) to positive and negative variable values and generating the slope (210) based on the second part (208), wherein the conversion includes bit complementing.
 32. The converter (10) according to claim 31, wherein when the coefficient term (211) and the slope (210) are in ½-LSB phase shift, means (204) and mean (403) are arranged to perform a complementation as 1-complementation. 